package ee.logsimulator.ui.druid;

public class ActorInfo {

  private int row;
  private int col;

  private int maxHealth = 160000;
  private int currentHealth = maxHealth;
  private Hot rejuvenation;
  private Hot regrowth;
  private Hot wildGrowth;
  private Hot lifebloom;

  public ActorInfo(int row, int col) {
    this.row = row;
    this.col = col;
  }

  public int getRow() {
    return row;
  }

  public int getCol() {
    return col;
  }

  public int getCurrentHealth() {
    return currentHealth;
  }

  public void setCurrentHealth(int currentHealth) {
    this.currentHealth = currentHealth;
  }

  public int getMaxHealth() {
    return maxHealth;
  }

  public void setMaxHealth(int maxHealth) {
    this.maxHealth = maxHealth;
    currentHealth = maxHealth;
  }

  public void increaseMaxHealth(int diff) {
    maxHealth = maxHealth + diff;
  }

  public void setRejuvenation(Hot rejuvenation) {
    this.rejuvenation = rejuvenation;
  }

  public Hot getRejuvenation(int time) {
    if (!(rejuvenation != null && time >= rejuvenation.getStart() && time - rejuvenation.getStart() < rejuvenation.getDuration())) {
      return null;
    }
    return rejuvenation;
  }

  public void setRegrowth(Hot regrowth) {
    this.regrowth = regrowth;
  }

  public Hot getRegrowth(int time) {
    if (!(regrowth != null && time >= regrowth.getStart() && time - regrowth.getStart() < regrowth.getDuration())) {
      return null;
    }
    return regrowth;
  }

  public void setWildGrowth(Hot wildGrowth) {
    this.wildGrowth = wildGrowth;
  }

  public Hot getWildGrowth(int time) {
    if (!(wildGrowth != null && time >= wildGrowth.getStart() && time - wildGrowth.getStart() < wildGrowth.getDuration())) {
      return null;
    }
    return wildGrowth;
  }

  public void setLifebloom(Hot lifebloom) {
    this.lifebloom = lifebloom;
  }

  public Hot getLifebloom(int time) {
    if (!(lifebloom != null && time >= lifebloom.getStart() && time - lifebloom.getStart() < lifebloom.getDuration())) {
      return null;
    }
    return lifebloom;
  }
}
